<?php

namespace App\Enums;

class HomePageTabEnum
{

    const ENUM = [
        ['id' => 1, 'scene' => 'recommend'],
        ['id' => 2, 'scene' => 'technology'],
        ['id' => 3, 'scene' => 'commodity'],
        ['id' => 4, 'scene' => 'moment'],
    ];

    public static function getSceneById($id)
    {
        foreach (self::ENUM as $item) {
            if ($item['id'] == $id) {
                return $item['scene'];
            }
        }
        return null;
    }

    public static function getIdByScene($scene)
    {
        foreach (self::ENUM as $item) {
            if ($item['scene'] == $scene) {
                return $item['id'];
            }
        }
        return null;
    }
}
